#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>

int main(void){
    int fd1, fd2, fd3;
    int ret;

    fd1 = open("./empty",O_RDWR);
    if(fd1 == -1){
        perror("OPEN1 ERROR");
        ret =-1;
        goto err1;
    }

    fd2 = open("./empty",O_RDWR);
    if(fd2 == -1){
        perror("OPEN2 ERROR");
        ret =-1;
        goto err2;
    }

    fd3 = open("./empty",O_RDWR);
    if(fd3 == -1){
        perror("OPEN3 ERROR");
        ret = -1;
        goto err3;
    }
    printf("fd1= %d \n fd2= %d \n fd3= %d \n",fd1,fd2,fd3);
    ret = 0;
    err1:
    close(fd1);
    err2:
    close(fd2);
    err3:
    close(fd3);
    exit(ret);
}